home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual dBase v5.5 / SAMPLES1.PAK / SWITCH.WFM < prev    next >
Text File  |  1995-07-18  |  3KB  |  107 lines

  1. *******************************************************************************
  2. *  PROGRAM:      Switch.wfm
  3. *
  4. *  WRITTEN BY:   Borland Samples Group
  5. *
  6. *  DATE:         5/93
  7. *
  8. *  UPDATED:      7/95
  9. *
  10. *  REVISION:     $Revision:   1.31  $
  11. *
  12. *  VERSION:      Visual dBASE
  13. *
  14. *  DESCRIPTION:  This is a very simple program illustrating the use of VBX
  15. *                controls with Visual dBASE.  The Forms Designer helps
  16. *                you work with VBX controls by allowing you to visually
  17. *                manipulate and change the VBX control properties just like
  18. *                you can with the regular Visual dBASE built in controls
  19. *
  20. *  PARAMETERS:   None
  21. *
  22. *  CALLS:        Switch.vbx  (VBX control)
  23. *
  24. *  USAGE:        DO Switch.wfm
  25. *
  26. *******************************************************************************
  27. create session
  28. set talk off
  29. set ldCheck off
  30.  
  31. ** END HEADER -- do not remove this line*
  32. * Generated on 07/11/95
  33. *
  34. parameter bModal
  35. local f
  36. f = new SWITCHFORM()
  37. if (bModal)
  38.    f.mdi = .F. && ensure not MDI
  39.    f.ReadModal()
  40. else
  41.    f.Open()
  42. endif
  43. CLASS SWITCHFORM OF FORM
  44.    Set Procedure To BUTTONS.CC additive
  45.    this.OnOpen = CLASS::FORM_ONOPEN
  46.    this.Width = 25.666
  47.    this.Top = 5.2344
  48.    this.Height = 6.7646
  49.    this.Left = 24.833
  50.    this.Text = ""
  51.    this.ColorNormal = "BTNTEXT/BTNFACE"
  52.  
  53.     load dll &_dbwinhome.samples\SWITCH.VBX
  54.    DEFINE BISWITCH BISWITCH1 OF THIS;
  55.        PROPERTY; 
  56.          OnOpen CLASS::BISWITCH1_ONOFF,;
  57.          Width 10.0342,;
  58.          Top 1.5,;
  59.          Height 3.9102,;
  60.          Left 8.2979,;
  61.          VBStream "SWITCH.BFM 56",;
  62.          OnOn CLASS::BISWITCH1_ONON,;
  63.          OnOff CLASS::BISWITCH1_ONOFF
  64.  
  65.    DEFINE SAMPLEINFOBUTTON SWITCHINFOBUTTON OF THIS;
  66.        PROPERTY; 
  67.          Width 3.5,;
  68.          Height 1.1758,;
  69.          Left 22,;
  70.          Group .T.
  71.  
  72.    Procedure Form_OnOpen
  73.    ****************************************************************************
  74.    
  75.    form.switchInfoButton.sampleName = "Switch.wfm"
  76.    
  77.    
  78.    ****************************************************************************
  79.  
  80.    Procedure BISWITCH1_OnOn
  81.    
  82.    * Indicate switch is on, and change form color.
  83.    ****************************************************************************
  84.    
  85.    this.caption = "ON"
  86.    form.colorNormal = "BTNTEXT/R+"
  87.    
  88.    
  89.    ****************************************************************************
  90.    
  91.    Procedure BISWITCH1_OnOff
  92.    
  93.    * Indicate switch is off, and change form color back to normal.
  94.    ****************************************************************************
  95.    
  96.    this.caption = "OFF"
  97.    form.colorNormal = "BTNTEXT/BTNFACE"
  98.    
  99.    
  100. ENDCLASS
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.